package org.carabiner.example;

import java.awt.Color;
import java.awt.Rectangle;

import junit.framework.TestCase;

import org.carabiner.util.DebugImage;

public class TestDefaultShapeModel extends TestCase
{  
  private ShapeModel model;

  protected void setUp() throws Exception
  {
    model = new DefaultShapeModel();
    super.setUp();
  }

  protected void tearDown() throws Exception
  {
    model = null;
    super.tearDown();
  }
  
  public void testRender()
  {
    Rectangle rect = new Rectangle(20, 20, 100, 100);
    model.addShape(rect, Color.RED);
    DebugImage image = new DebugImage(500, 500, Color.WHITE);
    model.render(image.createGraphics());
    assertTrue(image.polylineExists(rect, Color.RED));
  }

}
